<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script type="text/javascript">
var isIe = $.browser.msie;
var valueFilterNum = 0;

//定义全局变量记录分页信息  
var paramData = {  
 page:1,  
 rows:60,
 sortOrder:'desc', 
 sortColumn:''
};  
var msgOut={};
</script>
<style type="text/css">
/*.condition{
	float:left; 
	height:25px;
	border:1px solid #fff;
}
.condition .mylabel{
	width:80px;
	float:left; 
	border:0px solid #fff;
}
.condition .mybetween{
	width:400px;
}
.condition .myinput{
	width:150px;
	float:left; 
	border:0px solid #fff;
}
.condition .myfilter{
	width:200px;
	float:left; 
	border:0px solid #fff;
}

.clearboth{
	clear:both;
}*/

</style>
</head>

<%@taglib uri="/struts-tags" prefix="s" %>  
<body>
<div class="easyui-layout" data-options="fit:true"  id="conditionNorth" style="visibility:hidden;">
	<div data-options="region:'east'" style="width:100px;text-align:center; ">
		<div style="height: 2px;"></div>
		<a id='queryBtn_Filter' href='#' class='easyui-linkbutton' data-options="iconCls:'icon-search'" onclick='javascript:queryBtn_Filter();'>查询</a>
	</div>
	<div data-options="region:'center'" style="overflow:hidden;padding-left: 3px;padding-top: 3px;">
		<div id="_conditionContentDiv" style="border: 0px solid red;">
			<script type="text/javascript">
			var columnPropertyArr = new Array();
			var columnPropertyTypeArr = new Array();
			</script>
			<s:iterator var="column" value="#attr.columnsTag.conditionColumnList" status="st" >
			<div class="condition">
				<s:if test="#column.columnType.contains('combotree')">
					<label class="mylabel"><s:property value="columnShowName"/>：</label>
					<div class="myinput">
						<input id="${column.columnName}"  name="${column.columnName}" class="easyui-combotree" style="width:110px;"
						        data-options="url:'${path}${column.optionsPage}',editable:false">
						</input>
						<a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-no'"
						   onclick="javascript:clearCombotree('${column.columnName}')">
						</a>
					</div>
					<script type="text/javascript">
					columnPropertyArr[columnPropertyArr.length] = '${columnName}';
					columnPropertyTypeArr[columnPropertyTypeArr.length] = 'combotree';
					</script>
				</s:if>
				<!-- check is select -->
		        <s:elseif test="#column.columnType.contains('combobox')">
					<div class="item">
						<label class="mylabel"><s:property value="columnShowName"/>：</label>
						<div class="myinput">
							<!-- 使用上一页面传过来的ID，作为查询条件，PS:查询一个公司下所有部门，在公司列表中右击查询，传_id，作为部门的外建 
							s:if test="#parameters._id!=null && #column.columnName.indexOf('_id')!=-1"
							-->
							<%
							pageContext.setAttribute("_prePageListId",request.getParameter("_id"));
							%>
							<s:if test="#attr._prePageListId!=null && #column.columnName==#attr.columnsTag.templateTable.foreignKey">
								<s:select
								    id="%{#column.columnName}"
								    name="%{#column.columnName}"
									value="%{#attr._prePageListId}"
								    list="#column.a1TemplateColumnOptionDtoList"
								    listKey="keyName" 
								    listValue="valueName"
								    theme="simple"
								    cssStyle="width:100px"
								    data-options="editable:false"
							    	cssClass="easyui-combobox"/>

							</s:if>
							<s:else>
								<s:select
								    id="%{#column.columnName}"
								    name="%{#column.columnName}"
								    value="%{#column.defaultValue}"
								    list="#column.a1TemplateColumnOptionDtoList"
								    listKey="keyName"
								    listValue="valueName"
								    theme="simple"
								    data-options="editable:false"
								    cssStyle="width:100px"
							    	cssClass="easyui-combobox"/>
						    </s:else>
					    </div>
						<script type="text/javascript">
						columnPropertyArr[columnPropertyArr.length] = '${columnName}';
						columnPropertyTypeArr[columnPropertyTypeArr.length] = 'combobox';
						</script>
				    </div>
				</s:elseif>
				<s:elseif test="#column.queryType=='between'">
					<s:if test="#column.columnType.contains('date')">
						<div class="dateitem">
							<!-- 日期范围 -->
							<label class="mylabel"><s:property value="columnShowName"/>：</label>
							<div class="myinput" style="width: 420px;">
								<input type="text" id="${columnName}_Start" name="${columnName}_Start" size='20'
									   class='<s:if test="#column.columnType.contains('datetime')">easyui-datetimebox</s:if><s:else>easyui-datebox</s:else>'/>
								~
								<input type="text" id="${columnName}_End" name="${columnName}_End" size='20'
									   class='<s:if test="#column.columnType.contains('datetime')">easyui-datetimebox</s:if><s:else>easyui-datebox</s:else>'/>
							</div>
							<script type="text/javascript">
								columnPropertyArr[columnPropertyArr.length] = '${columnName}_Start';
								columnPropertyArr[columnPropertyArr.length] = '${columnName}_End';
								columnPropertyTypeArr[columnPropertyTypeArr.length] = 'date';
								columnPropertyTypeArr[columnPropertyTypeArr.length] = 'date';
							</script>
						</div>
					</s:if>
					<%--columnDataType是从数据库中取值在Tag中替换的--%>
					<s:elseif test="#column.columnDataType=='int' || #column.columnDataType=='long' || #column.columnDataType=='bigint'">
						<div class="dateitem">
							<!-- 日期范围 -->
							<label class="mylabel"><s:property value="columnShowName"/>：</label>
							<div class="myinput">
								<input type="text" class="easyui-numberbox" id="${columnName}_Start" name="${columnName}_Start" size='20'/>
								&nbsp;&nbsp;&nbsp;~
							</div>
							<div class="myinput">
								<input type="text" class="easyui-numberbox" id="${columnName}_End" name="${columnName}_End" size='20'/>
							</div>
							<script type="text/javascript">
								columnPropertyArr[columnPropertyArr.length] = '${columnName}_Start';
								columnPropertyArr[columnPropertyArr.length] = '${columnName}_End';
								columnPropertyTypeArr[columnPropertyTypeArr.length] = 'input';
								columnPropertyTypeArr[columnPropertyTypeArr.length] = 'input';
							</script>
						</div>
					</s:elseif>
				</s:elseif>
				<s:elseif test="#column.columnType.contains('date')">
					<div class="dateitem">
						<!-- 日期范围 -->
						<label class="mylabel"><s:property value="columnShowName"/>：</label>
						<div class="myinput">
							<input type="text" id="${columnName}" name="${columnName}" size='20'
									class='<s:if test="#column.columnType.contains('datetime')">easyui-datetimebox</s:if><s:else>easyui-datebox</s:else>'/>
						</div>
						<script type="text/javascript">
						columnPropertyArr[columnPropertyArr.length] = '${columnName}';
						columnPropertyTypeArr[columnPropertyTypeArr.length] = 'date';
						</script>
					</div>
				</s:elseif>
				<s:else>
					<div class="item">
						<label class="mylabel"><s:property value="columnShowName"/>：</label>
						<div class="myinput"><input type="text" class="easyui-textbox" id="${columnName}" name="${columnName}" value="${defaultValue}" placeholder="${queryTypePlaceholder}"/></div>
						<script type="text/javascript">
						columnPropertyArr[columnPropertyArr.length] = '${columnName}';
						columnPropertyTypeArr[columnPropertyTypeArr.length] = 'input';
						</script>
					</div>
				</s:else>
				
			</div>
			</s:iterator>  
			
			<div class="clearboth"></div>
			<div style="height: 0px;"></div>
		</div>
	</div>
</div>			
</body>
</html>